<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                template="./../template/WorkspaceTemplate.xhtml">

    <ui:define name="top">
        
    </ui:define>

    <ui:define name="left">
    </ui:define>

    <ui:define name="right">
      
    </ui:define>

    <ui:define name="content">

        <h:form id="salesLeadForm">

            <h:panelGrid columns="4" style="width: 100%">
                <h:outputLabel style="font-weight: bold; font-size: 200%" value="View Sales Lead"/>
                <h:outputLabel style="font-weight: bold" value=""/>
                <h:outputLabel style="font-weight: bold" value=""/>
                <h:outputLink id="lnk" value="#" style="right: 250px">  
                        <p:printer target="salesLeadForm" />  
                        <p:graphicImage value="/images/print.png" height="45px" width="45px"/>  
                </h:outputLink>
            </h:panelGrid>
            <br/>

            <p:panel id="panel1" header="Basic Information">
                <h:panelGrid columns="5" cellpadding="10">
                    <h:outputLabel style="font-weight: bold" value="Client ID: "/>
                    <h:outputLabel style="font-weight: bold" value="Company Name: "/>
                    <h:outputLabel style="font-weight: bold" value="Category: "/>
                    <h:outputLabel style="font-weight: bold" value="Customer Executive: "/>
                    <h:outputLabel style="font-weight: bold" value=""/>
                    <h:outputText id="clientId" value="#{salesLeadManagerBean.salesLead.clientId}"/>
                    <h:outputText id="companyName" value="#{salesLeadManagerBean.salesLead.companyName}"/>
                    <h:outputText id="category" value="#{salesLeadManagerBean.salesLead.category}"/>   
                    <h:outputText id="customerExecutive" value="#{salesLeadManagerBean.salesLead.customerExecutive.firstName} #{salesLeadManagerBean.salesLead.customerExecutive.lastName}"/>
                </h:panelGrid>
            </p:panel>
            <br/>
            <p:panel id="panel2" header="Contact Information">
                <p:dataTable var="cr" value="#{salesLeadManagerBean.salesLead.contactRecords}" emptyMessage="No contact records added yet.">  
                    <p:column>  
                        <f:facet name="header">  
                            Name
                        </f:facet>  
                        <h:outputText value="#{cr.name}" />  
                    </p:column>  

                    <p:column>  
                        <f:facet name="header">  
                            Designation
                        </f:facet>  
                        <h:outputText value="#{cr.jobTitle}" />  
                    </p:column>  

                    <p:column>  
                        <f:facet name="header">  
                            Phone
                        </f:facet>  
                        <h:outputText value="#{cr.phone}" />  
                    </p:column>  

                    <p:column>  
                        <f:facet name="header">  
                            E-mail
                        </f:facet>  
                        <h:outputText value="#{cr.email}" />  
                    </p:column>
                </p:dataTable>
                <br/>
            </p:panel>
            <br/>
            <p:panel id="panel3" header="Shipping Address">
                <p:dataTable rowIndexVar="rowIndex" var="sa" value="#{salesLeadManagerBean.salesLead.shippingAddress}" emptyMessage="No shipping address added yet." style="border-color: transparent">
                    <p:column style="border-color: transparent">
                        <p:fieldset legend="Shipping Address #{rowIndex + 1}" style="font-weight: bold">
                            <h:panelGrid columns="2" style="border-color: transparent" width="100%">

                                <h:outputLabel value="Address Line 1: "/>
                                <h:outputText value="#{sa.addressLine1}"/>

                                <h:outputLabel value="Address Line 2: "/>
                                <h:outputText value="#{sa.addressLine2}"/>

                                <h:outputLabel value="Zip Code: "/>
                                <h:outputText value="#{sa.zipCode}"/>

                                <h:outputLabel value="City: "/>  
                                <h:outputText value="#{sa.city}"/>

                                <h:outputLabel value="State: "/>
                                <h:outputText value="#{sa.stateName}"/>

                                <h:outputLabel value="Country: "/>
                                <h:outputText value="#{sa.country}"/>

                            </h:panelGrid>
                        </p:fieldset>
                        <br/>
                    </p:column>
                </p:dataTable>
                <br/>
            </p:panel>
            <br/>
            <p:panel id="panel4" header="Industry Information (Optional)">
                <h:panelGrid columns="2" cellpadding="10">
                    <h:outputLabel for="industry" value="Industry Sector: "/>
                    <h:outputText id="industry" value="#{salesLeadManagerBean.salesLead.industry}"/>
                </h:panelGrid>
            </p:panel>
            <br/>
            <p:commandButton value="Back" onclick="javascript: history.go(-1)"/>
        </h:form>

    </ui:define>

    <ui:define name="bottom">
       
    </ui:define>

</ui:composition>
